package com.future.bantang.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.future.bantang.constants.BanTang;
import com.future.bantang.fragment.BaseFragment;
import com.future.bantang.fragment.ShoppingListFragment;
import com.future.bantang.fragment.UserRecommendFragment;

/**
 * Created by Administrator on 16-1-16.
 */
public class ShoppingListFragmentPagerAdapter extends FragmentPagerAdapter {
    public ShoppingListFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
       //Fragment fragment= BaseFragment.getInstance(ShoppingListFragment.class);
        Fragment fragment=null;
        if (position==0){
            fragment= BaseFragment.getInstance(ShoppingListFragment.class);
        }else {
            fragment=BaseFragment.getInstance(UserRecommendFragment.class);
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return BanTang.shoppingListTitles[position];
    }
}
